#include "MySqlMgr.h"

MySqlMgr::~MySqlMgr()
{
}

bool MySqlMgr::text()
{
	return dao_.text();
}

int MySqlMgr::RegUser(const string& name, const string& pwd, const string& email)
{
	return dao_.RegUser(name, pwd, email);
}

bool MySqlMgr::CheckEmail(const std::string& name, const std::string& email)
{
	return dao_.CheckEmail(name, email);
}

bool MySqlMgr::UpdatePwd(const std::string& name, const std::string& pwd)
{
	return dao_.UpdatePwd(name, pwd);
}

bool MySqlMgr::CheckPwd(const std::string& email, const std::string& pwd, UserInfo& userinfo)
{
	return dao_.CheckPwd(email,pwd,userinfo);
}

bool MySqlMgr::GetApplyInfo(int login_uid, std::vector<std::shared_ptr<ApplyInfo>>& apply)
{
	return dao_.GetApplyInfo(login_uid,apply,0,10);
}

bool MySqlMgr::AddFriendReq(const int& from_uid, const int& to_uid)
{
	return dao_.AddFriendReq(from_uid,to_uid);
}

int MySqlMgr::AuthFriendApply(const int& from_uid, const int& to_uid,const std::string& backname)
{
	return dao_.AuthFriendApply(from_uid,to_uid, backname);
}

bool MySqlMgr::GetFriendInfo(const int& self_uid,std::vector<std::shared_ptr<UserInfo>>& friend_List)
{
	return dao_.GetFriendInfo(self_uid, friend_List);
}

std::shared_ptr<UserInfo> MySqlMgr::GetUser(int uid)
{
	return dao_.GetUser(uid);
}

std::shared_ptr<UserInfo> MySqlMgr::GetUser(string name)
{
	return dao_.GetUser(name);
}

MySqlMgr::MySqlMgr() {

};